package com.function;

import java.util.function.Function;

public class FuncitionTest {
    public static void main(String[] args) {
        Function<String, Integer> function = new Function<String, Integer>() {
            @Override
            public Integer apply(String s) {
                return  Integer.parseInt(s);
            }
        } ;
        Integer apply = function.apply("12345");
        System.out.println(apply);
        Function<String,Integer> function1=s->{
            if (s==null || "".equals(s.trim())){
                return 0;
            }else{
                return Integer.parseInt(s);
            }
        };

        System.out.println(function.apply("100"));
    }

}
